<?php 
namespace app\admin\controller;
class ClientComplaint extends Common
{
	function _initialize()
	{
		
	}

	function complaintList()
	{

		$list = db('client_complaint')
				->alias('cc')
				->field('cc.*,c.aid,c.activity')
				->join('client c','cc.client_id=c.id')
				->order('cc.id DESC');

		$list = $list->paginate(10);
        $this->assign([
            'list'=>$list,
        ]);
        return view();
	}

	function view()
	{
		$id = input()['id'];
    	$complaintInfo = db('client_complaint')->where('id',$id)->find();
    	$clientInfo = db('client')->where('id',$complaintInfo['client_id'])->find();
    	$this->assign([
    		'clientInfo'=>$clientInfo,
    		'complaintInfo'=>$complaintInfo,
    	]);
        return view();
	}

	function edit()
	{

	}

}